package com.project.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.project.bean.DisasterPrevention.EventBean;
import com.project.bean.ExpertConsultation.ConsultBean;
import com.project.mapper.IConsultMapper;
import com.project.mapper.IEventMapper;
import com.project.service.IConsultService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class IConsultServiceImpl extends ServiceImpl<IConsultMapper, ConsultBean> implements IConsultService {

    @Resource
    private IEventMapper eventMapper;

    @Resource
    private IConsultMapper consultMapper;

    @Override
    public List<EventBean> findConsultEvent(String eventStage) {

        return eventMapper.findConsultEvent(eventStage);

    }

    @Override
    public EventBean findEvent(int eventId) {

        return eventMapper.findEvent(eventId);
    }

    @Override
    public void addConsult(ConsultBean consultBean) {

        this.consultMapper.addConsult(consultBean);
    }

//    @Override
//    public void updateConsult(int consultId, String consultResult) {
//
//        ConsultBean consultBean = new ConsultBean();
//        consultBean.setConsultId(consultId);
//        consultBean.setConsultResult(consultResult);
//
//        this.baseMapper.updateById(consultBean);
//
//    }
//
//    @Override
//    public void addMe(int eventId, ConsultBean consultBean) {
//
//        this.baseMapper.addMe(eventId,consultBean);
//    }



    @Override
    public void updateConsult(int eventId, String consultResult) {

        consultMapper.updateConsult(eventId,consultResult);

    }

    @Override
    public List<ConsultBean> findConsult(int eventId){
        return null;
    }


}
